﻿@if (Percent == null)
{
	<Loading></Loading>
}
else
{
	<Liquid @ref=_chart Config="config" />
}


@code {
	[Parameter]
	public decimal Percent { get; set; } = 0;
	readonly LiquidConfig config = new LiquidConfig();
	[Parameter]
	public int height { get; set; }
	[Parameter]
	public int width { get; set; }
	private IChartComponent _chart;

	protected override async void OnParametersSet()
	{
		config.Height = height;
		config.Width = width;
		config.Percent = Percent;
		config.AutoFit = true;
		if (_chart != null)
		{
			await _chart.UpdateConfig(config);
		}
		
		base.OnParametersSet();
	}

}
